
#include "Complex.h"
#include <iomanip>

Complex::Complex(double i ,double j){
    this->i = i;
    this->j = j;
}

std::string toStr(double value){
   std::ostringstream oss;
   oss << std::fixed << std::setprecision(2) << value;
   return oss.str();
}

std::string Complex::to_string(){
    
    return toStr(this->i) + "+"+toStr(this->j) +"i";
}



Complex Complex::operator+ (Complex & c){
    Complex c3 ;

    c3.i = c.i+this->i;
    c3.j = c.j+this->j;

    return c3;

}